import router from 'vue-router'
import Vue from 'vue'
const login = () => import('../components/login.vue')
const home = () => import('../components/home/home.vue')
const artical = () => import('../components/home/artical/artical.vue')
const notes = () => import('../components/home/notes/notes.vue')
const write = () => import('../components/home/write/write.vue')
const setting = () => import('../components/home/setting/setting.vue')
const artical_ = () => import('../components/home/artical/artical_.vue')
const myArtical = () => import('../components/home/artical/myArtical.vue')
const search=()=>import('../components/home/search/search.vue')
Vue.use(router)
const route = [
    {
        path: '/',
        redirect: '/login'
    }, {
        path: '/login',
        name: 'login',
        component: login
    }, {
        path: '/home',
        name: 'home',
        redirect: '/home/artical',
        component: home,
        children: [
            {
                path: 'artical',
                name: 'artical',
                component: artical
            },
            {
                path: 'notes',
                name: 'notes',
                component: notes
            }, {
                path: 'write',
                name: 'write',
                component: write
            }, {
                path: 'setting',
                name: 'setting',
                component: setting
            }, {
                path: 'artical/:id',
                name: 'artical_',
                component: artical_
            }, {
                path: 'myArtical/:id',
                name: 'theArtical',
                component: artical_

            }, {
                path: 'myArtical',
                name: 'myArtical',
                component: myArtical
            }, {
                path: 'search',
                name: 'search',
                component:search
            }
        ]
    }
]
const r = new router({
    routes: route,
    mode: 'hash'
})
export default r